<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>计算器</title>
		<script type="text/javascript">
			var num1=parseFloat(prompt('请输入第一个数',1));
			var num2=parseFloat(prompt('请输入第二个数',2));
			var opr=prompt('请输入运算符号');
			switch(opr){
				case '+':
				result=num1+num2;
				break;
				case '-':
				result=num1-num2;
				break;
				case '*':
				result=num1*num2;
				break;
				case '/':
				result=num1/num2;
				break;
				default:
				document.write('请输入正确的运算符号');
			}
			document.write(num1+opr+num2+'='+result)
		</script>
	</head>
	<body>
	</body>
</html>
